<?php
class classPDO{
	private static $host='localhost';
	private static $bdName='bd_camping';
	private static $userDb='root' ;    	
	private static $pass='root' ;

	private static $pdo;
	private static $_pdo=null;

	private function __construct(){
	    classPDO::$pdo = new PDO('mysql:host='.classPDO::$host.';dbname='.classPDO::$bdName , classPDO::$userDb, classPDO::$pass);
	}

	public static function getPDO(){
		if(classPDO::$_pdo==null){
			classPDO::$_pdo=new classPDO();
		}
		return classPDO::$_pdo;
	}
    public function getTypeLocation(){
		$req='SELECT *
			FROM type_location';
		$res = classPDO::$pdo->query($req);
		$return= $res->fetchAll();
		return $return;
	}
}
   /* public function gz($name,$pass){
        $req='SELECT *
	        FROM type_location';
        $res = classPDO::$pdo->query($req);
        $return= $res->fetchAll();
        return $return;
	}*/

$pdo=classPDO::getPDO();
?>

